package hikari.gui.guicomponents;

import com.gooddies.wiring.annotations.PostWiring;
import com.gooddies.wiring.annotations.Wire;
import com.gooddies.wiring.annotations.WiringComponent;
import hikari.utils.Utils;

import javax.swing.*;
import java.awt.*;

/**
 * Created with IntelliJ IDEA.
 * User: Dmitry
 * Date: 24.11.12
 * Time: 22:08
 */
@WiringComponent
public class ColoredPanel extends JPanel {

    @Wire
    private Utils utils;

    public ColoredPanel() {
    }

    @PostWiring
    private void postInit() {
        setOpaque(true);
        int r = utils.random(255);
        int g = utils.random(255);
        int b = utils.random(255);
        setPreferredSize(new Dimension(100, 100));
        setBackground(new Color(r, g, b));
    }
}
